package engine.display.newAttack
{
	import flash.display.GraphicsGradientFill;
	import flash.display.GraphicsPath;
	import flash.display.GraphicsSolidFill;
	import flash.display.GraphicsStroke;
	import flash.display.IGraphicsData;
	import flash.display.JointStyle;
	import flash.display.Sprite;
	import flash.geom.Matrix;

	public class ScenePos extends Sprite
	{
		private var _pos:int	=	-1;
		
		
		public function ScenePos()
		{
			super();
			drawHotArea();
		}
		
		public function get pos():int
		{
			return _pos;
		}

		public function set pos(value:int):void
		{
			_pos = value;
			if(_pos < 9)			
			{
				graphics.clear();
				drawHotArea(true);
			}
		}
		

		private function drawHotArea(scale:Boolean =  false):void
		{
			graphics.beginFill	(0xFF0000,	0);
			//graphics.drawEllipse(-25,-75,50,100);		
			// stroke object 
			
			var dx:int = -40;
			var dy:int = -75;
			//var stroke:GraphicsStroke = new GraphicsStroke(4);
			var stroke:GraphicsStroke = new GraphicsStroke(4);			
			stroke.joints = JointStyle.ROUND; 
			stroke.fill = null;// solid stroke 
			
			// fill object 
			var fill:GraphicsGradientFill = null; 
//			var fill:GraphicsGradientFill = new GraphicsGradientFill(); 
//			fill.colors = [0x0000FF, 0xEEFFEE]; 
//			fill.matrix = new Matrix(); 
//			fill.matrix.createGradientBox(70,70, Math.PI/2); 
			// path object 
			var path:GraphicsPath = new GraphicsPath(new Vector.<int>(), new Vector.<Number>()); 
			path.commands.push(1,2,3); 
//			path.data.push(37 + dx,0  + dy, 
//						   0  + dx,56 + dy, 
//						   37 + dx,112+ dy,
//						   74 + dx,56 + dy); 
			if(false == scale)
			{
				path.data.push( 30 + dx,-20  + dy, 
								0  + dx,75 + dy,
								50 + dx,110  + dy,
								110 + dx,75+ dy);
			}
			else
			{
				path.data.push( 30 + dx,-20  + dy, 
								0  + dx,75 + dy,
								40 + dx,110  + dy,
								100 + dx,75+ dy);
			}
			
			// combine objects for complete drawing 
			var drawing:Vector.<IGraphicsData> = new Vector.<IGraphicsData>(); 
			drawing.push(stroke, fill, path); 
			
			graphics.drawGraphicsData(drawing);
			
			graphics.endFill();
		}		
	}
}